import time
st=time.time
def bubble (f):
    a=[]
    for i in f:
        a.append(int())
    st=time.time()
    for x in range (len(a)-2):
        for y in range(x+1,len(a)-1):
            if a[y]>a[y+1]:
                a[y],a[y+1] = a[y+1], a[y]

    
    end = time.time()            
    return end-st
s1 = open('m1_sorted.txt')
s2 = open('m2_reverse.txt')
s3 = open('m3_shuffle.txt')
print("m1_sorted", int (bubble(s1)*1000),'milliseconds')
print('m2_reverse', int (bubble(s2)*1000),'milliseconds')
print('m3_shuffle', int (bubble(s3)*1000),'milliseconds')
